/*
 * @lc app=leetcode.cn id=1446 lang=typescript
 *
 * [1446] 连续字符
 */

// @lc code=start
function maxPower(s: string): number {
    let max = 0;
    let count = 1;
    let last = s[0];
    for (let i = 1; i < s.length; i++) {
        const element = s[i];
        if (element === last) {
            count++;
        } else {
            max = Math.max(max, count);
            count = 1;
            last = element;
        }
    }
    return Math.max(max, count);
}
// @lc code=end
